<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <title>小说管理</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../../css/bootstrap.min.css">
    <link rel="stylesheet" href="../../css/font-awesome.min.css">
    <link rel="stylesheet" href="../../plugins/jqgrid/ui.jqgrid-bootstrap.css">
    <link rel="stylesheet" href="../../plugins/ztree/css/metroStyle/metroStyle.css">
    <link rel="stylesheet" href="../../css/main.css">
    <script src="../../libs/jquery.min.js"></script>
    <script src="../../plugins/layer/layer.js"></script>
    <script src="../../libs/bootstrap.min.js"></script>
    <script src="../../libs/vue.min.js"></script>
    <script src="../../plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="../../plugins/jqgrid/jquery.jqGrid.min.js"></script>
    <script src="../../plugins/ztree/jquery.ztree.all.min.js"></script>
    <script src="../../js/common.js"></script>
</head>
<style>
    .tags-line{
        display: inline-block;
    }
    .addBookfrom{
        width:100%;
    }
    .form-group{
        /*width:auto;*/
        height: 50px;
        padding: 0px;
    }
    .form-group>div{
        height:100%;
    }
    .col-sm-6,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-9{
        padding-right:0;
    }

</style>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showDom == 'list'">
        <div class="grid-btn" class="form-group col-sm-2">
            <div class="form-group col-sm-2">
                <select v-model="book.categoryid" id="select_div" style="width: 200px" @change="cateName">
                    <option selected  value="">全部</option>
                    <option v-for="sel in sels" v-bind:value="sel.id">{{sel.categoryyname}}</option>
                </select>
            </div>
            <div class="form-group col-sm-2">
                <input type="text" class="form-control" v-model="q.bookname" @keyup.enter="query" placeholder="书名">
            </div>
            <a class="btn btn-default" @click="query">查询</a>
            <div class="btn-group" role="group" aria-label="...">
                <a v-show="hasPermission('sys:book:save')" class="btn btn-primary btn-sm" @click="add"><i class="fa fa-plus"></i>&nbsp;管理员添加新书</a>
                <a v-show="hasPermission('sys:book:save2')" class="btn btn-primary btn-sm" @click="add2"><i class="fa fa-plus"></i>&nbsp;作者添加新书</a>
                <a v-show="hasPermission('sys:book:update')" class="btn btn-primary btn-sm" @click="updatebook"><i class="fa fa-plus"></i>&nbsp;管理员修改书籍</a>
                <a v-show="hasPermission('sys:book:update2')" class="btn btn-primary btn-sm" @click="updatebookbyauthor"><i class="fa fa-plus"></i>&nbsp;作者修改书籍</a>
                <a v-show="hasPermission('sys:book:savesection')" class="btn btn-primary btn-sm" @click="getSectionList"><i class="fa fa-pencil-square-o"></i>&nbsp;章节列表</a>
                <a v-show="hasPermission('sys:book:savevolume')" class="btn btn-primary btn-sm" @click="getVolumeList"><i class="fa fa-pencil-square-o"></i>&nbsp;卷列表</a>
                <!-- <a v-if="hasPermission('sys:book:savesection')" class="btn btn-primary btn-sm" @click="addsection"><i class="fa fa-pencil-square-o"></i>&nbsp;添加章节</a> -->
                <!-- <a v-if="hasPermission('sys:book:update')" class="btn btn-primary btn-sm" @click="updatesection"><i class="fa fa-pencil-square-o"></i>&nbsp;修改章节</a> -->
                <a v-show="hasPermission('sys:book:delete')" class="btn btn-primary btn-sm" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            </div>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-if="showDom == 'sectionList'">aaaa
        <table id="jqGrid2">aaaa</table>
        <div id="jqGridPager2">aaaa</div>
    </div>

    <div v-show="showDom == 'addOrEdit'" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">所属分类</div>
                <div class="col-sm-10">
                    <select v-model="book.categoryid" style="width: 200px">
                        <option selected  value="">请选择</option>
                        <option v-for="sel in sels" v-bind:value="sel.id">{{sel.categoryyname}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">书名</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="book.bookname" placeholder="书名"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">作者</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="book.authorName" placeholder="作者"/>
                </div>
            </div>
            <!--<div class="form-group">
                <div class="col-sm-2 control-label">书籍编号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="book.bookno" placeholder="书籍编号"/>
                </div>
            </div>-->
            <div class="form-group">
                <div class="col-sm-10">
                    <div class="col-sm-2 control-label">来源</div>
                    <input type="text" class="form-control" v-model="book.source" placeholder="来源"/>
                </div>
            </div>
            <!--<div class="form-group">
                <div class="col-sm-2 control-label">排序号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="book.booknum" placeholder="排序号"/>
                </div>
            </div>-->
            <div class="form-group">
                <div class="col-sm-2 control-label">图片地址</div>
                <div class="col-sm-10">
                    <input type="file" accept="image/gif,image/jpeg,image/jpg,image/png" ref="file" id="file" name="file" @change="changeImage($event)" class="form-control" placeholder="图片地址"/>
                    <img :src="book.picurl" style="max-width: 400px;position:fixed;top:calc(25%);right:100px;">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否连载</div>
                <label class="radio-inline">
                    <input type="radio" name="isserialize" value="false" v-model="book.isserialize"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="isserialize" value="true" v-model="book.isserialize"/> 是
                </label>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否付费</div>
                <label class="radio-inline">
                    <input type="radio" name="ispay" value="false" v-model="book.ispay"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="ispay" value="true" v-model="book.ispay"/> 是
                </label>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否三界都在看</div>
                <label class="radio-inline">
                    <input type="radio" name="issanjie" value="false" v-model="book.issanjie"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="issanjie" value="true" v-model="book.issanjie"/> 是
                </label>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否中原武侠</div>
                <label class="radio-inline">
                    <input type="radio" name="iswuxia" value="false" v-model="book.iswuxia"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="iswuxia" value="true" v-model="book.iswuxia"/> 是
                </label>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否仙界大陆</div>
                <label class="radio-inline">
                    <input type="radio" name="isxianjie" value="false" v-model="book.isxianjie"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="isxianjie" checked value="true" v-model="book.isxianjie"/> 是
                </label>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否奇幻世界</div>
                <label class="radio-inline">
                    <input type="radio" name="isqihuan" value="false" v-model="book.isqihuan"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="isqihuan" value="true" v-model="book.isqihuan"/> 是
                </label>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否宫廷侯爵</div>
                <label class="radio-inline">
                    <input type="radio" name="isgongting" value="false" v-model="book.isgongting"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="isgongting" value="true" v-model="book.isgongting"/> 是
                </label>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否现言优选</div>
                <label class="radio-inline">
                    <input type="radio" name="isxianyan" value="false" v-model="book.isxianyan"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="isxianyan" value="true" v-model="book.isxianyan"/> 是
                </label>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否主编精选</div>
                <label class="radio-inline">
                    <input type="radio" name="isjingxuan" value="false" v-model="book.isjingxuan"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="isjingxuan" value="true" v-model="book.isjingxuan"/> 是
                </label>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否热门精选</div>
                <label class="radio-inline">
                    <input type="radio" name="isremen" value="false" v-model="book.isremen"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="isremen" value="true" v-model="book.isremen"/> 是
                </label>
            </div>
            <div class="form-group" style="height: 220px;">
                <div class="col-sm-2 control-label">简介</div>
                <textarea v-model="book.introduction" style="width: 400px;height: 200px">
                </textarea>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>

    <div v-show="showDom == 'addOrEdit2'" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">所属分类</div>
                <div class="col-sm-10">
                    <select v-model="book.categoryid" style="width: 200px">
                        <option selected  value="">请选择</option>
                        <option v-for="sel in sels" v-bind:value="sel.id">{{sel.categoryyname}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">书名</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="book.bookname" placeholder="书名"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">图片地址</div>
                <div class="col-sm-10">
                    <input type="file" accept="image/gif,image/jpeg,image/jpg,image/png" ref="file" id="file" name="file" @change="changeImage($event)" class="form-control" placeholder="图片地址"/>
                    <img :src="book.picurl" style="max-width: 400px;position:fixed;top:calc(25%);right:100px;">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否付费</div>
                <label class="radio-inline">
                    <input type="radio" name="ispay" value="false" v-model="book.ispay"/> 否
                </label>
                <label class="radio-inline">
                    <input type="radio" name="ispay" value="true" v-model="book.ispay"/> 是
                </label>
            </div>
            <div class="form-group" style="height: 220px;">
                <div class="col-sm-2 control-label">简介</div>
                <textarea v-model="book.introduction" style="width: 400px;height: 200px">
                </textarea>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="../../js/modules/sys/book.js"></script>
</body>
</html>